#[cfg(test)] 
mod test {
    #[tokio::test(flavor = "multi_thread")]
    // wait with handle of task spawn
    async fn wait_spawn_task() {
        let handle = tokio::spawn( async {
            "return value"
        });

        let out = handle.await.unwrap();
        assert_eq!("return value", out);
    }

    #[tokio::test(flavor = "multi_thread")]
    // T: 'static : static T or owner any type (use move)
    async fn pass_stack_value_to_task() {
        let v= vec![1, 2, 3];
        let handle = tokio::spawn( async move {
            println!("Here is a vec: {:?}", v);  //v=> T: 'static bound 
            v[0]
        });

        let out = handle.await.unwrap();
        assert_eq!(out, 1);
    }

    #[tokio::test(flavor = "multi_thread")]
    async fn use_rc_in_task(){
        use tokio::task::yield_now;
        use std::rc::Rc;
        tokio::spawn(async {
            { //use rc in single_thread
                let rc = Rc::new("hello");
                println!("{rc}");
            }

            yield_now().await;
        });
    }
}
